package com.cnzhy.service;

import com.cnzhy.entity.CrmAdminUser;
import com.cnzhy.service.fallback.UserServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 赵 岩
 * @author zhaoyan5
 * FeignClient的value对应调用服务的spring.applicatoin.name
 */
@Component
@FeignClient(value = "nacos-provider", fallback = UserServiceFallback.class)
public interface UserFeignService {

    /**
     * 获取信息
     *
     * @param name
     * @return
     */
    @GetMapping("/get")
    String getMessage(@RequestParam("name") String name);

    /**
     * 获取用户
     *
     * @param userId
     * @return
     */
    @GetMapping("user/{userId}")
    CrmAdminUser getCrmAdminUser(@PathVariable long userId);

}
